Events Subscribers
Register events delegate
registerEventsDelegate
Method
Registers a delegate for the SDK events.
Parameters
Parameter | Notes |
---|---|
listener Required Object | Any object implementing one or more of the available delegate interfaces. |
Code example
public class ObjectHelper implements Events.SmartposRequired, Events.Status, Events.Log, Events.TransactionStarted, Events.CurrentTransactionStatus, Events.ConnectionStatusChanged, Events.EndOfTransaction, Events.TransactionResultReady {
...
private void setEventsHandler() {
// Register this class as listener for events
this.api.registerEventsDelegate(this);
...
}
}
Returns
Parameter | Notes |
---|---|
Boolean | True if the new delegate was added successfully. |
Unregister events delegate
unregisterEventsDelegate
Method
Unregisters an object from SDK events.
Parameters
Parameter | Notes |
---|---|
listener Required Object | Any object implementing one or more of the available delegate interfaces. |
Code example
public class ObjectHelper implements Events.SmartposRequired, Events.Status, Events.Log, Events.TransactionStarted, Events.CurrentTransactionStatus, Events.ConnectionStatusChanged, Events.EndOfTransaction, Events.TransactionResultReady {
...
private void unsubscribeEventsDelegate() {
// Stop receiving events
this.api.unregisterEventsDelegate(this);
...
}
Returns
Parameter | Notes |
---|---|
Boolean | True if the new delegate was removed successfully. |